import request from '@/utils/request'

export function getDepartment() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

export function simpleApi() {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}

export function addDepartmentApi(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 获取编辑的那个信息
export function editDepartmentApi(id) {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}

// 提交编辑的那个
export function editDepart(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
